<template>
  <div id="app">

    <!-- <guide v-if='isShowGuide'></guide> -->
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" />
    <tab></tab>
  </div>
</template>
<script>
import { isAuth } from '@/api'
export default {
  data () {
    return {
      // isShowGuide: false
    }
  },
  components: {
    tab: () => import('@/components/tab'),
    // guide: () => import('@/components/guide'),
  },
  created () {
    // let firstRecord = localStorage.getItem('firstRecord')
    // if (!firstRecord) {
    //   this.isShowGuide = true;
    //   localStorage.setItem('firstRecord', 1)
    // } else {
    //   localStorage.setItem('firstRecord', ++firstRecord)
    // }
    isAuth().then(res => {
       
        // window.location.href ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx57c89676f397cfd1&redirect_uri=https%3A%2F%2Fsqweixin.haoshui.com.cn%2Fweixin%2Foauth2&response_type=code&scope=snsapi_userinfo&state=svmShuiqoo1&component_appid=wx98d2ea7671c59607#wechat_redirect"
      
      if (res&&res.authUrl&&process.env.NODE_ENV !== "development") {
       window.location.replace(res.authUrl)
      }

    })




  },
};
</script>
<style lang="scss">
@import "@/common/scss/index.scss";
@import "@/common/scss/animate.scss";

#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #111;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #111;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
.fade-enter-active,
.fade-leave-active {
  transition: all 0.3s ease;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: all 0.4s ease;
}
.slide-enter,
.slide-leave-to {
  opacity: 0;
  transform: translate3d(100%, 0, 0);
}

// .fade-enter-active,
// .fade-leave-active {
//   transition: opacity 2s;
// }
// .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
//   opacity: 0;
// }
</style>
